package com.plian.system.dao.sys.grouprole;

import com.plian.Tools.pagedata.PageData;
import com.plian.system.dao.DaoSupport;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
public class GroupRoleDao {
    @Resource(name = "daoSupport")
    private DaoSupport dao;

    /**
     * 保存集团可操作的角色
     * @param list
     * @throws Exception
     */
    public void  PerUserConfig(List<PageData> list) throws Exception {
        dao.save("GroupRoleMapper.PerUserConfig",list);
    }

    /**
     * 根据账号查询相关角色
     * @param userId
     * @throws Exception
     */
    public List<PageData>  queryPerUser(String userId) throws Exception {
       return (List<PageData>) dao.findForList("GroupRoleMapper.queryPerUser",userId);
    }
    public List<PageData>  getRole() throws Exception {
       return (List<PageData>) dao.findForList("GroupRoleMapper.getRole",null);
    }
    public void del_PerUserOrg(List<String> userIds) throws Exception {
       dao.delete("GroupRoleMapper.del_PerUser",userIds);
    }


}
